package com.syedu.day06.v2;

import java.time.LocalDate;

/**
 * description：测试类
 * @author Administrator
 * @date 2022/3/15 13:36
 */
public class TestEmployee {
    public static void main(String[] args) {
        //创建三个不同的员工对象
        Employee e1 = new Employee("BB", 21, LocalDate.of(2002, 12, 12), 10000.0);
        Employee e2 = new Employee("AA", 24, LocalDate.of(2012, 6, 20), 12000.0);
        Employee e3 = new Employee("CC", 22, LocalDate.of(2020, 8, 1), 8000.0);
        //把员工添加到数组中
        Employee[] employees = {e1, e2, e3};
        //遍历数组
        for (Employee e : employees) {
            System.out.println(e.name + "," + e.age + "," + e.hireDate + "," + e.salary);
            e.work();
        }
    }
}